<template>
    <div class="msg-box">
        <div class="msg-content">
            <svg @click.stop="closeMsg()" v-show="showSvg" t="1590462557869" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2756" width="200" height="200">
                <path d="M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z" fill="#d81e06" p-id="2757"></path>
            </svg>
            <svg @click.stop="closeMsg()" v-show="!showSvg" t="1590462720740" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3607" width="200" height="200">
                <path d="M511.996 960.648c-247.924 0-449.606-201.685-449.606-449.609 0-247.924 201.682-449.608 449.606-449.608 247.93 0 449.613 201.684 449.613 449.608C961.609 758.965 759.926 960.648 511.996 960.648L511.996 960.648zM511.996 112.95c-218.958 0-397.088 178.13-397.088 397.089 0 218.924 178.13 397.091 397.088 397.091 218.928 0 397.095-178.167 397.095-397.091C909.086 291.08 730.923 112.95 511.996 112.95L511.996 112.95zM707.153 313.542c-15.062-8.787-34.204-3.451-42.864 11.296L463.588 672.521 351.313 568.969c-11.861-12.552-31.755-13.179-44.37-1.254-12.615 11.609-13.305 31.691-1.443 44.242l143.465 132.421c11.799 12.552 31.693 13.18 44.308 1.255 3.829-3.451 225.302-389.415 225.302-389.415C727.3 341.47 722.153 322.015 707.153 313.542L707.153 313.542z" p-id="3608"></path>
            </svg>
            <p class="msg-text">{{msg}}</p>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return {
            showSvg:true,
            msg:""
        }
    },
    methods:{
        closeMsg(){
            document.body.removeChild(this.$el);
            this.$destroy();
        }
    },
    mounted(){
        document.body.appendChild(this.$el);
    }
}
</script>
<style scoped>
.msg-box{
    position: absolute;
    width: 100%;
    height: 100%;
    /* text-align: center; */
    background-color: rgba(0,0,0,0.6);
}
.msg-content{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 2.5rem;
    height: 2.5rem;
    /* background-color: rgba(0,0,0,0); */
    background-color: white;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 10px;
}
svg:first-child,svg:nth-child(2){
    width: 1rem;
    height: 1rem;
    /* color: #ccc; */
    background-color: rgba(0,0,0,0);
    padding-top: 10px;
}
.msg-text{
    padding-top: 0.3rem;
    height: 0.5rem;
    line-height: 0.5rem;
    background-color: white;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
</style>